package com.lcc.book.demos.web.Service;

import com.lcc.book.demos.web.Mapper.UserInfoMapper;
import com.lcc.book.demos.web.Model.UserInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;
@Service
public class UserService {
    @Autowired
    private UserInfoMapper userInfoMapper;
    public UserInfo getUserInfoByUsername(String userName){
        if (!StringUtils.hasLength(userName)){
            return null;
        }
        //调用Mapper
        UserInfo userInfo = userInfoMapper.selectUserByName(userName);
        //返回查询到的用户信息
        return userInfo;
    }
}
